<?php

namespace App\Http\Requests;

use App\Http\Requests\Request;

class CommentInsertRequest extends Request
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'status' => 'required',
            'content' => 'required',
        ];
    }
    /*
        用户显示字段的错误信息
    */
    public function messages()
    {
        return [
            'status.required'=>'请选择好评或差评', 
            'content.required'=>'评论内容必须填写',
        ];
    }
}
